<template>
	<view class="start_content">
		<image src="../../static/image/start_bg.png" class="start_bg"></image>
		<view class="lang">
			<text @tap="change('en')">English</text>
			<text @tap="change('zh')">中文</text>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				language:""
			}
		},
		onLoad() {
		
		},
		methods:{
			change(lang) {
				var _this=this
				if(lang=='en'){
					_this.language='en'
					uni.setStorage({
					    key: 'language',
					    data: 'en',
					    success: function () {
					        console.log('英文');
					    }
					});
					var system_info="zh_CN"
					system_info === 'en' ? system_info = this._i18n.locale = 'zh_CN' : system_info = this._i18n.locale = 'en'
					uni.setStorageSync('system_info',system_info)
					uni.reLaunch({
						url: 'index'
					})
					uni.setStorage({
								key:'lang',
								data:lang,
								success() {
									_this.$CommonJS.navigateTo('./entry?lg='+lang)
								}
							})
				}else{
					_this.language='zh'
					uni.setStorage({
					    key: 'language',
					    data: 'zh',
					    success: function () {
					        console.log('中文');
					    }
					});
					console.log("中文")
					var system_info="en"
					system_info === 'en' ? system_info = this._i18n.locale = 'zh_CN' : system_info = this._i18n.locale = 'en'
					uni.setStorageSync('system_info',system_info)
					uni.reLaunch({
						url: 'index'
					})
					uni.setStorage({
								key:'lang',
								data:lang,
								success() {
									_this.$CommonJS.navigateTo('./entry?lg='+lang)
								}
							})
				}
			
			}
		}
	}
</script>

<style lang="stylus">
	page
		width 100%
		height 100%
		background linear-gradient(180deg, #020102 0%, #191930 100%)
	.start_content
		width 100%
		height 100%
		position relative
		
	.start_bg
		width 100%
		height 1014upx
		position absolute
		left 50%
		top 50%
		transform  translate(-50%,-50%)
		z-index 2
		
	.lang
		width 100%
		height 60upx
		position absolute
		left 0
		top 75%
		transform translateY(-75%)
		z-index 3
		display flex
		flex-direction row
		justify-content center
		align-items center
		
	.lang	text
		font-size 18px
		font-family ZHSRXT-GBK
		font-weight 400
		color #FFFFFF
		text-shadow 0px 0px 9px #23C9A7
		text-decoration underline
		opacity 1
		margin 0 54upx

</style>
